/**
 * 
 */
package spitfire.ksim.evaluation;

import javax.swing.SwingUtilities;

import spitfire.ksim.simulation.KSimulation;
import spitfire.ksim.view.KSimulationView;


/**
 * @author Adam
 *
 */
public class KSimApp {

	public static void main(String[] args) {
		final KSimulation simulation = new KSimulation();
		
		if (args.length == 0 || !args[0].equalsIgnoreCase("-nogui")) {
			SwingUtilities.invokeLater(new Runnable() {
				@Override
				public void run() {
					new KSimulationView(simulation);
				}
			});
		}
		
		EvaluationClass eval = new EvaluationClass(simulation);
		eval.loadConfig(args[1]);
		eval.setupScenario();
		int revertDay = 0;
		for (String s : args) {
			if (s.contains("-r")) {
				revertDay = Integer.parseInt(s.substring(2));
				break;
			}
		}
		eval.runEvaluation(24L * 3600 * 1000 * revertDay);
	}
}
